home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 014 / zapper.tqt / ZAPPER.TXT
Encoding:
Text File  |  1984-06-16  |  12.8 KB  |  234 lines

  1.  
  2.            ___________________________________________________________________
  3.                     
  4.                                         THE ZAPPER
  5.           
  6.                                     Volume 1, Number 1
  7.                         For Registered Users Of FreeSoft Products
  8.            ___________________________________________________________________
  9.           
  10.                                 Copy Protecting Diskettes
  11.                                 -------------------------
  12.           
  13.           The Ultra-Format program has the capability to format diskettes that 
  14.           cannot be copied by DOS's DISKCOPY utility.  This article will 
  15.           explain how to use the Ultra-Format program to produce copy-protected 
  16.           diskettes.
  17.           
  18.           The whole idea behind producing copy-protected diskettes is to know 
  19.           exactly what DISKCOPY can and can't duplicate.  Specifically, 
  20.           DISKCOPY looks for and copies only the following:
  21.              1) Side 0 and Side 1
  22.              2) Tracks 0 to 39
  23.              3) Sectors 1 to 8 (512 bytes each).
  24.           
  25.           Knowing this, it is easy to confuse DISKCOPY by formatting a diskette 
  26.           outside of these "normal" limits.  Although we certainly can't format
  27.           more than two or less than one diskette sides, there are a number of 
  28.           other approaches we can take.  All disk drives we have used, for 
  29.           instance, have been able to format 1 or 2 more tracks than the 
  30.           manufacturer specifies.  On your IBM-PC, you could actually format 
  31.           tracks 40 and 41 if you wanted to.  Since DISKCOPY does not look for 
  32.           these tracks during a backup, (and, by the way, neither do many 
  33.           "pirate" backup programs), any copies made will not contain the 
  34.           information in these tracks.  Although, due to the way DOS handles 
  35.           free disk space, the extra tracks can't be used for programs or 
  36.           files, you can use the sectors in these tracks to contain special 
  37.           passwords.  Use the FORMAT STANDARD TRACK option in Ultra-Format to 
  38.           format a track 40 on a scratch diskette.  Then, using Ultra-Zap, go 
  39.           in with the DISPLAY/MODIFY DISK SECTOR function to insert a secret 
  40.           password into one of that track's sectors.  If your program has the 
  41.           ability to read a raw disk sector, this password can be checked for 
  42.           validity.  We will discuss this "read a sector" function in more 
  43.           detail later.
  44.           
  45.           Another good way to fool DISKCOPY is to format a standard track of 8 
  46.           sectors of 512 bytes each, but numbered weirdly (Sectors 32, 34, 5, 
  47.           93, 87, 2, 14, and 201, for instance).  Again, a password can be 
  48.           inserted and later verified in one of these sectors.  Remember that 
  49.           DISKCOPY expects the sectors to be numbered consecutively from 1 to 
  50.           8 and won't copy any others.
  51.           
  52.           Finally, you can also format a track containing sectors of a 
  53.           different length than 512 btyes.  The disk controller circuit in your 
  54.           IBM-PC has the ability to format sectors of either 128, 256, 512, or 
  55.           1024 bytes each.  You can forget about formatting a track of ten 1024 
  56.           byte sectors, though - there just isn't enough room on a track.  A 
  57.           good rule of thumb is to format sectors in relation to their size.  
  58.           That is, four 1024 byte sectors per track, eight 512 byte sectors 
  59.           per track, sixteen 256 byte sectors per track, or thirty two 128 byte 
  60.           sectors per track.  All of these combinations give the same number of 
  61.           available bytes for data.
  62.            2)
  63.           
  64.           When using sectors of other than 512 byte lengths, there is another 
  65.           matter to consider.  Several bytes in the Disk Parameter Table will 
  66.           have to be fiddled with in order to format a track correctly.  If you 
  67.           don't adjust these values, the resulting track will contain CRC 
  68.           errors.  CRC (cyclic redundency check) is just a checksum that is 
  69.           used by the disk controller circuit to confirm that data is being 
  70.           read properly.  Of course, you could purposefully format a track with 
  71.           CRC errors, try to read a sector, and verify that it is a non-pirated 
  72.           copy when it returns a CRC error code.  To do this, just format a 
  73.           track using the FORMAT NON-STANDARD TRACK option in Ultra-Format.  
  74.           When specifying sectors, go ahead and specify the first 7 sectors as 
  75.           would be found in a standard track (logical sector numbers 1 through 
  76.           7 with a length value of 2).  On the eight sector, specify a length 
  77.           value of 3 (meaning 256 bytes).  When sector 8 is later read 
  78.           (assuming the Disk Parameter Table bytes/sector value is changed to 
  79.           value 3), you should get a CRC error.
  80.           
  81.           Don't forget, when you later want to read odd-sized sectors, you will 
  82.           have to change the bytes per sector value in the Disk Parameter Table 
  83.           to reflect the sector's size.  Don't forget to restore this byte back 
  84.           to it's original value before doing other disk I/O or exiting your 
  85.           program.
  86.           
  87.           Here are the bytes in the Disk Parameter Table that will need to be 
  88.           modified before formatting oddly-sized (not 512 bytes) sectors:
  89.           
  90.           1) Byte #5 (Highest Sector Number On Track): This byte should contain 
  91.              the number of sectors you wish to format, not necessarily the      
  92.              highest logical sector number.
  93.           
  94.           2) Byte #6 (Gap Length For Diskette Reads): We're not exactly sure if 
  95.              this byte actually affects a format operation, but it doesn't hurt 
  96.              to go ahead and modify it.  The value should be changed in 
  97.              relation to the sector size.  For instance, if you're going to     
  98.              format a track of four 1024 byte sectors, cut the value in this    
  99.              byte in half.  Double it for sixteen 256 byte sectors and multiply 
  100.              it by four for thirty two 128 byte sectors.
  101.           
  102.           3) Byte #8 (Gap Between Sectors): This definitely needs to be changed 
  103.              before formatting.  Modify it in relation to the sector size, as   
  104.              was discussed in 2) above.
  105.           
  106.           All in all, getting a format that works is the result of 
  107.           experimentation.  Since we had no need for formatting copy-protected 
  108.           diskettes with our products, our experience with this is limited.  We 
  109.           would appreciate hearing about any particularly interesting 
  110.           copy-protection schemes you come up with using the Ultra-Utilities.
  111.           
  112.           Just putting a weirdly formatted track or sector on a diskette won't 
  113.           keep your programs from being copied.  DISKCOPY will go ahead and 
  114.           copy everything else.  Therefore, you will need to insert in your 
  115.           program some means of reading a given sector and checking a password 
  116.           in it before continuing with the execution of the program.
  117.           
  118.           There is really no easy way of doing this outside of an assembly 
  119.           language subroutine.  Fortunately, the routine needs only to be 10 or 
  120.           20 lines long since the IBM-PC BIOS contains a sector read 
  121.           subroutine.  This is accessed through the INTERRUPT 13H vector.
  122.            3)
  123.  
  124.           Basically, all your routine has to do is put certain values into the 
  125.           8088 registers and call this routine.  Here's the register setup 
  126.           that's required:
  127.           
  128.           AH=2 (this specifies a "READ" operation)
  129.           AL=1 (this specifies a single sector read)
  130.           ES:BX (address of the memory buffer you wish the sector data to       
  131.                 be copied into)
  132.           CH   (track number you wish to read 0-255)
  133.           CL   (sector number you wish to read 0-255)
  134.           DH   (side number you wish to read 0 or 1)
  135.           DL   (drive number you wish to use 0=Drive A, 1=Drive B, etc.)
  136.           
  137.           After filling these registers as required, execute an INT 13H 
  138.           instruction.  This does the actual sector read.  Afterwards, the 
  139.           CARRY flag is set if the read failed or is reset if the read was 
  140.           successful.  If an error occured, the AH register contains the error 
  141.           code.  Here are the meanings of the possible error codes:
  142.           
  143.           AH=1   Bad disk command was issued (registers setup correctly?)
  144.           AH=2   Address mark not found (track formatted?)
  145.           AH=3   Tried to write a write protected disk (AH=2 upon entry?)
  146.           AH=4   Sector not found
  147.           AH=8   Direct Memory Access overrun
  148.           AH=9   Direct Memory Access crossed a 64K boundary
  149.           AH=16  Cyclic redundency check error (CRC)
  150.           AH=32  Disk controller failure
  151.           AH=64  Track seek failed
  152.           AH=128 Drive timed out (drive door open?  disk mounted?)
  153.           
  154.           All of the above error codes are in decimal format.
  155.           -------------------------------------------------------------------
  156.           Once last caveat, although many drives are capable of formatting 
  157.           tracks higher than 39, most diskette manufacturers don't certify 
  158.           these tracks before selling the diskettes.
  159.           -------------------------------------------------------------------
  160.                                     MONTHLY UNPROTECTS
  161.                                     ------------------
  162.           The following tips are for those who are registered users of the 
  163.           software concerned.  Please don't rip off those who have worked hard 
  164.           to put such fine products on the market.
  165.           
  166.           LOTUS 1-2-3
  167.           -----------
  168.           This works with the newer releases of 1-2-3
  169.           1) RENAME 123.EXE 123.XYZ
  170.           2) DEBUG 123.XYZ
  171.           3) type U ABA9
  172.           4) you should see   INT 13    at that address
  173.           5) type E ABA9 90 90
  174.           6) type W
  175.           7) type Q
  176.           8) COPY 123.XYZ onto another diskette
  177.           9) RENAME 123.XYZ UNP123.EXE
  178.           
  179.           UNP123.EXE may now be freely copied and/or moved onto a hard disk.
  180.            4)
  181.           VISICALC
  182.           --------
  183.           1) Format a single sided diskette with FORMAT B:/S (or whatever drive 
  184.              letter is appropriate)
  185.           2) DEBUG
  186.           3) Put VisiCalc diskette in Drive A
  187.           4) type L 100 0 138 2
  188.           5) type M 0 3FF 7000
  189.           6) type R CS
  190.           7) write down this number (we'll call this Hold #1)
  191.           8) add 700H to this number and type this in.
  192.           9) type R DS
  193.           10) write down this number (we'll call this Hold #2)
  194.           11) add 700H to this number and type this in.         
  195.           12) Take the rightmost two digits of Hold #1 and insert those in 
  196.               place of the LL symbols in step 13.  Put the leftmost two digits  
  197.               in place of the HH in step 13.
  198.           13) type E 107 LL HH (substituting your values for LL & HH)
  199.           14) type E 24D BB A8 00 90
  200.           15) type G =1B8 26B
  201.           16) After a few burps and chirps, you will be back at the DEBUG       
  202.               prompt.
  203.           17) type R CS
  204.           18) type in the value you saved as Hold #1
  205.           19) type R DS
  206.           20) type in the value you saved as Hold #2
  207.           21) type R BX
  208.           22) type the number 0
  209.           23) type R CX
  210.           24) if you have VC version 1.0, type the number 6802, if you have     
  211.               version 1.1, type the number 6B64
  212.           25) remove the Visicalc diskette from Drive A and mount your freshly  
  213.               formatted diskette in Drive A
  214.           26) type N VC.COM
  215.           27) type W
  216.           28) type Q
  217.           
  218.           VC.COM can now be freely copied and placed on a hard disk.
  219.           
  220.           These unprotects have been garnered from various bulletin boards      
  221.           around the country.  If you've got a favorite unprotect, why not send 
  222.           it in for the next issue of THE ZAPPER!
  223.           ---------------------------------------------------------------------
  224.                                    LAST MINUTE ADDTION
  225.                                    -------------------
  226.           The following BASIC program lines will allow you to modify the Disk 
  227.           Parameter Table values:
  228.           20000 DEF SEG=0:A1%=120:A2%=PEEK(A1%)+256*PEEK(A1%+1)
  229.           20010 DEF SEG=PEEK(A1%+2)+256*PEEK(A1%+3)
  230.           20020 POKE A2%+3,3:'THIS PUTS A LENGTH OF VALUE OF 3 INTO THE THIRD
  231.           20030 '             BYTE (BYTES PER SECTOR VALUE) OF THE D.P.T.
  232.           20040 DEF SEG
  233.  
  234.